package com.aop;

public class TrackingContext {

    private static ThreadLocal<String> trackingId = ThreadLocal.withInitial(() -> null);

    // 设置追踪 ID
    public static void setTrackingId(String id) {
        trackingId.set(id);
    }

    // 获取追踪 ID
    public static String getTrackingId() {
        return trackingId.get();
    }

    // 清理追踪 ID
    public static void clear() {
        trackingId.remove();
    }
}

